package a.j;

import a.c.d;

import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Collections;

public class xd
  implements wb.g_
{
  public static int a;
  
  public boolean a(tb paramtb, h paramh, GeneralPath paramGeneralPath, double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    if (!bool2) {
      if (!paramtb.w()) {
        return false;
      }
    }
    if (!bool2) {}
    boolean bool1 = b(paramtb, paramh, paramGeneralPath, paramDouble1, paramDouble2) > 0;
    if (!bool2) {
      if (bool1)
      {
        Point2D localPoint2D1 = paramtb.x();
        if (!bool2) {
          if (localPoint2D1.distanceSq(paramDouble1, paramDouble2) < 25.0D) {
            return false;
          }
        }
        Point2D localPoint2D2 = paramtb.y();
        if ((bool2) || (localPoint2D2.distanceSq(paramDouble1, paramDouble2) >= 25.0D)) {
          if (bool2) {}
        }
        return bool1;
      }
    }
    return bool1;
  }
  
  public int b(tb paramtb, h paramh, GeneralPath paramGeneralPath, double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    d locald = paramtb.i();
    Object localObject;
    double d2;
    double d5;
    if (((bool2) || (locald != null)) && ((bool2) || (locald.g())) && (paramh.size() == 1))
    {
      localObject = (g)locald.c();
      ld localld = ((g)localObject).w(locald.e());
      if (!bool2) {
        if (localld.f(paramDouble1, paramDouble2)) {
          return 0;
        }
      }
      eb localeb1 = (eb)paramh.a();
      d2 = localeb1.b();
      double d3 = localeb1.c();
      Point2D.Double localDouble1 = new Point2D.Double(d2, d3);
      double d4 = paramtb.k().a(localld);
      d5 = paramtb.k().b(localld);
      Point2D.Double localDouble2 = new Point2D.Double(d4, d5);
      double d7 = localDouble2.distance(localDouble1);
      double d8 = 10.0D;
      double d9 = d7 + d8;
      double d10 = (d2 + d4) / 2.0D;
      double d11 = (d3 + d5) / 2.0D;
      Ellipse2D.Double localDouble3 = new Ellipse2D.Double(d10 - d9 / 2.0D, d11 - d9 / 2.0D, d9, d9);
      if ((bool2) || (localDouble3.contains(paramDouble1, paramDouble2)))
      {
        double d12 = (bool2) || (d7 > d8) ? d7 - d8 : 0.0D;
        if (!bool2) {
          if (d12 > 0.0D)
          {
            Ellipse2D.Double localDouble4 = new Ellipse2D.Double(d10 - d12 / 2.0D, d11 - d12 / 2.0D, d12, d12);
            if (bool2) {
              break label361;
            }
            if (localDouble4.contains(paramDouble1, paramDouble2)) {
              return 0;
            }
          }
        }
        label361:
        if (!bool2) {}
        return (paramDouble1 - d4) * (d3 - d5) + (paramDouble2 - d5) * (d4 - d2) < 0.0D ? 1 : 2;
      }
    }
    else
    {
      localObject = paramtb.x();
      double d1 = ((Point2D)localObject).getX();
      d2 = ((Point2D)localObject).getY();
      ArrayList localArrayList = new ArrayList();
      int i = a(paramtb, paramh, localArrayList);
      int j = i + 1;
      int k = 0;
      do
      {
        if (k >= localArrayList.size()) {
          break;
        }
        eb localeb2 = (eb)localArrayList.get(k);
        d5 = localeb2.b();
        double d6 = localeb2.c();
        if (bool1) {
          break label555;
        }
        if (Line2D.ptSegDistSq(d1, d2, d5, d6, paramDouble1, paramDouble2) < 25.0D) {
          return j;
        }
        j++;
        d1 = d5;
        d2 = d6;
        k++;
      } while (!bool1);
      Point2D localPoint2D = paramtb.y();
      if (bool2) {
        break label555;
      }
      if ((bool2) || (Line2D.ptSegDistSq(d1, d2, localPoint2D.getX(), localPoint2D.getY(), paramDouble1, paramDouble2) < 25.0D)) {
        return j;
      }
    }
    label555:
    return 0;
  }
  
  private static int a(tb paramtb, h paramh, ArrayList paramArrayList)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    paramArrayList.clear();
    paramArrayList.addAll(paramh);
    int i = 0;
    ld localld = paramtb.h();
    if (!paramArrayList.isEmpty()) {}
    do
    {
      localObject = (eb)paramArrayList.get(0);
      if (bool1) {
        break label101;
      }
      if (!bool2)
      {
        if (localld.f(((eb)localObject).b(), ((eb)localObject).c()))
        {
          paramArrayList.remove(localObject);
          i++;
        }
      }
      else {
        if (!bool1) {
          break;
        }
      }
      Collections.reverse(paramArrayList);
    } while (bool2);
    label101:
    Object localObject = paramtb.g();
    do
    {
      do
      {
        if (paramArrayList.isEmpty()) {
          break;
        }
        eb localeb = (eb)paramArrayList.get(0);
        if (bool1) {
          break label165;
        }
        if (!((ld)localObject).f(localeb.b(), localeb.c())) {
          break;
        }
        paramArrayList.remove(localeb);
      } while (!bool1);
    } while (bool2);
    Collections.reverse(paramArrayList);
    label165:
    return i;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.xd

 * JD-Core Version:    0.7.0.1

 */